﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Aluno.aspx.cs" Inherits="ManterAluno" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    
    <h2>
        Alunos</h2>
    <p>
    <asp:Button ID="btnNovoAluno" runat="server" Text="Cadastrar Novo Aluno" 
        onclick="Button2_Click" PostBackUrl="~/AlunoInserir.aspx" />
    </p>
    <p>
        <strong>Busca:</strong></p>
    <p>
        Nome do Aluno:
    <asp:TextBox ID="txtNome" runat="server" Width="237px"></asp:TextBox>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Matrícula:
        <asp:TextBox ID="txtMatricula" runat="server" Width="160px"></asp:TextBox>
    <br /><br />
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
        Text="Buscar" />
        <br />
</p>
    <p>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="ObjectDataSource1">
        <Columns>
            <asp:BoundField DataField="id" HeaderText="id" SortExpression="id" />
            <asp:BoundField DataField="Matricula" HeaderText="Matricula" 
                SortExpression="Matricula" />
            <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
            <asp:BoundField DataField="Sexo" HeaderText="Sexo" SortExpression="Sexo" />
            <asp:HyperLinkField DataNavigateUrlFields="id" 
                DataNavigateUrlFormatString="AlunoInserir.aspx?id={0}" 
                Text="Visualizar Informações" />
        </Columns>
    </asp:GridView>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            DataObjectTypeName="Dominio.AlunoVO" DeleteMethod="excluir" 
            InsertMethod="salvar" SelectMethod="list" TypeName="Negocio.AlunoNegocio" 
            UpdateMethod="salvar">
            <SelectParameters>
                <asp:ControlParameter ControlID="txtNome" Name="nome" PropertyName="Text" 
                    Type="String" />
                <asp:ControlParameter ControlID="txtMatricula" Name="matricula" 
                    PropertyName="Text" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
    <br />
    <br />
    </p>
    </asp:Content>

